<!DOCTYPE html><html lang="en" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>CodingDGSun's Blog</title><meta name="author" content="CodingDGSun"><meta name="copyright" content="CodingDGSun"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta property="og:type" content="website">
<meta property="og:title" content="CodingDGSun&#39;s Blog">
<meta property="og:url" content="https://sunjie23.gitee.io/codingdgsun/index.html">
<meta property="og:site_name" content="CodingDGSun&#39;s Blog">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/头像.7horht40yvwg.jpg">
<meta property="article:author" content="CodingDGSun">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/头像.7horht40yvwg.jpg"><link rel="shortcut icon" href="/codingdgsun/img/favicon.png"><link rel="canonical" href="https://sunjie23.gitee.io/codingdgsun/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/codingdgsun/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/codingdgsun/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: 'Copy successfully',
    error: 'Copy error',
    noSupport: 'The browser does not support'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: 'Just',
    min: 'minutes ago',
    hour: 'hours ago',
    day: 'days ago',
    month: 'months ago'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'CodingDGSun\'s Blog',
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2022-01-17 14:06:45'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/codingdgsun/atom.xml" title="CodingDGSun's Blog" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/头像.7horht40yvwg.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/codingdgsun/archives/"><div class="headline">Articles</div><div class="length-num">59</div></a></div></div></div><hr/></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header"><nav id="nav"><span id="blog_name"><a id="site-name" href="/codingdgsun/">CodingDGSun's Blog</a></span><div id="menus"><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">CodingDGSun's Blog</h1></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left_radius"><a href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AEbuild%E5%A4%B1%E8%B4%A5%E4%B9%8BMiniCssExtractPlugin/" title="React项目build失败之MiniCssExtractPlugin">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="React项目build失败之MiniCssExtractPlugin"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AEbuild%E5%A4%B1%E8%B4%A5%E4%B9%8BMiniCssExtractPlugin/" title="React项目build失败之MiniCssExtractPlugin">React项目build失败之MiniCssExtractPlugin</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2022-01-17T06:03:03.000Z" title="Created 2022-01-17 14:03:03">2022-01-17</time></span></div><div class="content">React项目build失败之MiniCssExtractPluginReact项目，最新依赖&quot;mini-css-extract-plugin&quot;: &quot;^2.5.0&quot;会导致项目npm run build失败：
12345node_modules/react-scripts/config/webpack.config.js:664        new MiniCssExtractPlugin(&#123;        ^TypeError: MiniCssExtractPlugin is not a constructor

解决方案：
1npm i -D --save-exact mini-css-extract-plugin@2.4.5

</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AE%E6%9E%84%E5%BB%BA%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/" title="React项目构建常用命令">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="React项目构建常用命令"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AE%E6%9E%84%E5%BB%BA%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/" title="React项目构建常用命令">React项目构建常用命令</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2022-01-17T06:01:56.000Z" title="Created 2022-01-17 14:01:56">2022-01-17</time></span></div><div class="content">React项目构建常用命令12345678//方法一：npm install -g create-react-app//安装create-react-appcreate-react-app hello-world-react//创建项目，项目名称不要有大写字母npm run start 或者 npm start //进入项目目录后，启动项目//方法二：cnpm i yarn -g //提高安装react项目速度npx create-react-app my-react //创建项目，项目名称不要有大写字母npm run start 或者 npm start //进入项目目录后，启动项目

注意:启动项目后可能出现如下报错：
1234567TypeError: MiniCssExtractPlugin is not a constructorpackage.json里面：  &quot;devDependencies&quot;: &#123;    &quot;mini-css-extract-plugin&quot;: &quot;2.4.5&quot;  &#125;导致
解决方案 ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/codingdgsun/2022/01/17/Mac-OS%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%80%E4%B8%AAReact%E9%A1%B9%E7%9B%AE/" title="Mac OS初始化一个React项目">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Mac OS初始化一个React项目"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2022/01/17/Mac-OS%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%80%E4%B8%AAReact%E9%A1%B9%E7%9B%AE/" title="Mac OS初始化一个React项目">Mac OS初始化一个React项目</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2022-01-17T05:58:21.000Z" title="Created 2022-01-17 13:58:21">2022-01-17</time></span></div><div class="content">Mac OS上，初始化一个React项目
初始化项目

1npm init -y

创建目录

1在项目根目录下，创建src源代码目录和dist产品目录

创建首页文件

1在src目录下创建index.html和index.js文件

安装webpack

123456789101112131415161718cnpm i webpack -Dpackage.json内容如下：&#123;  &quot;name&quot;: &quot;react&quot;,  &quot;version&quot;: &quot;1.0.0&quot;,  &quot;description&quot;: &quot;&quot;,  &quot;main&quot;: &quot;index.js&quot;,  &quot;scripts&quot;: &#123;    &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;  &#125;,  &quot;ke ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/codingdgsun/2022/01/17/MySQL%E8%AF%AD%E6%B3%95%E5%85%A5%E9%97%A8%EF%BC%88%E4%BA%8C%EF%BC%89/" title="MySQL语法入门（二）">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="MySQL语法入门（二）"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2022/01/17/MySQL%E8%AF%AD%E6%B3%95%E5%85%A5%E9%97%A8%EF%BC%88%E4%BA%8C%EF%BC%89/" title="MySQL语法入门（二）">MySQL语法入门（二）</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2022-01-17T05:54:56.000Z" title="Created 2022-01-17 13:54:56">2022-01-17</time></span></div><div class="content">MySQL语法入门（二）
数据库加密函数

12345SELECT MD5(&#x27;hello&#x27;);-- 5d41402abc4b2a76b9719d911017c592SELECT MD5(&#x27;HELLO&#x27;);-- eb61eead90e3b899c6bcbe27ac581660SELECT AES_ENCRYPT(&#x27;hello&#x27;, &#x27;key&#x27;);SELECT AES_DECRYPT(AES_ENCRYPT(&#x27;hello&#x27;, &#x27;key&#x27;), &#x27;key&#x27;);-- helloSELECT SHA(&#x27;hello&#x27;);-- aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d


控制流函数

1234567891011121314151617181920212223242526272829303132333435363738SELECT IF(1 &gt; 2, 3, 4);-- 4SELECT IFNULL(1 ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/codingdgsun/2022/01/17/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%BA%8C%EF%BC%88%E7%AE%80%E5%8D%95%EF%BC%89/" title="Java中常见面试题二（简单）">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Java中常见面试题二（简单）"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2022/01/17/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%BA%8C%EF%BC%88%E7%AE%80%E5%8D%95%EF%BC%89/" title="Java中常见面试题二（简单）">Java中常见面试题二（简单）</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2022-01-17T05:53:56.000Z" title="Created 2022-01-17 13:53:56">2022-01-17</time></span></div><div class="content">Java中常见面试题二（简单）
HashMap和Hashtable的区别？


线程是否安全： HashMap 是非线程安全的，Hashtable 是线程安全的,因为 Hashtable 内部的方法基本都经过synchronized 修饰。（如果你要保证线程安全的话就使用 ConcurrentHashMap 吧！）
效率：因为Hashtable加了synchronized锁。所以HashMap 要比 Hashtable 效率高一点。另外，Hashtable 基本被淘汰，不要在代码中使用它
对 Null key 和 Null value 的支持： HashMap 可以存储 null 的 key 和 value，但 null 作为键只能有一个，null 作为值可以有多个；Hashtable 不允许有 null 键和 null 值，否则会抛出 NullPointerException。
初始容量大小和每次扩充容量大小的不同 ：① 创建时如果不指定容量初始值，Hashtable 默认的初始大小为 11，之后每次扩充，容量变为原来的 2n+1。HashMap 默认的初始化大小为 16。之后每次扩 ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/codingdgsun/2022/01/07/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%B8%80%EF%BC%88%E5%9B%B0%E9%9A%BE%EF%BC%89/" title="Java中常见面试题一（困难）">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Java中常见面试题一（困难）"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2022/01/07/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%B8%80%EF%BC%88%E5%9B%B0%E9%9A%BE%EF%BC%89/" title="Java中常见面试题一（困难）">Java中常见面试题一（困难）</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2022-01-07T15:36:28.000Z" title="Created 2022-01-07 23:36:28">2022-01-07</time></span></div><div class="content">Java中常见面试题一（困难）
Redis的缓存击穿及解决方案


缓存击穿：这个跟缓存雪崩有点像，但是又有一点不一样，缓存雪崩是因为大面积的缓存失效，数据库崩溃了,而缓存击穿不同的是缓存击穿是指存在一个热点数据Key，有请求不断来访问这个Key，这么多请求在同一段时间内访问这个热点数据，当这个 Key 失效时间到了的时候，持续的这么多请求直接怂到数据库上了，就在这个 Key 值上击穿了缓存。
解决方案：设置热点数据永不过期或者加上互斥锁就搞定了。


索引的建立原则, 如何避免索引失效


索引的建立原则索引的设计需要遵循一些已有的原则，这样便于提升索引的使用效率，更高效的使用索引。(1)对查询频次较高，且数据量比较大的表，建立索引。(2)索引字段的选择，最佳候选列应当从where子句的条件中提取，如果where子句中的组合比较多，那么应当挑选最常用，过滤效果最好的列的组合。(3)如果where后有多个条件经常被用到，建议建立符合索引，复合索引需要遵循最左前缀法则，N个列组合而成的复合索引，相当于创建了N个索引。复合索引命名规则index_表名_列名1_列名2_列明3比如:creat ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/codingdgsun/2022/01/07/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%B8%80%EF%BC%88%E4%B8%AD%E7%AD%89%EF%BC%89/" title="Java中常见面试题一（中等）">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Java中常见面试题一（中等）"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2022/01/07/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%B8%80%EF%BC%88%E4%B8%AD%E7%AD%89%EF%BC%89/" title="Java中常见面试题一（中等）">Java中常见面试题一（中等）</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2022-01-07T15:35:32.000Z" title="Created 2022-01-07 23:35:32">2022-01-07</time></span></div><div class="content">Java中常见面试题一（中等）
SQL语句优化有哪些？数据库的优化怎样优化？


对查询进行优化，应尽量避免全表扫描，首先应考虑在 where 及 order by 涉及的列上建立索引。
应尽量避免在 where 子句中对字段进行 null 值判断，否则将导致引擎放弃使用索引而进行全表扫描。
应尽量避免在 where 子句中使用!=或&lt;&gt;操作符，否则引擎将放弃使用索引而进行全表扫描。


乐观锁和悲观锁的解释及其应用场景


**悲观锁(Pessimistic Lock)**，顾名思义，就是很悲观，每次去拿数据的时候都认为别人会修改，所以每次在拿数据的时候都会上锁，这样别人想拿这个数据就会block直到它拿到锁。传统的关系型数据库里边就用到了很多这种锁机制，比如行锁，表锁等，读锁，写锁等，都是在做操作之前先上锁。

**乐观锁(Optimistic Lock)**，顾名思义，就是很乐观，每次去拿数据的时候都认为别人不会修改，所以不会上锁，但是在更新的时候会判断一下在此期间别人有没有去更新这个数据，可以使用版本号等机制。乐观锁适用于多读的应用类型，这样可以提高吞吐量，像数据库 ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/codingdgsun/2022/01/07/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%B8%80%EF%BC%88%E7%AE%80%E5%8D%95%EF%BC%89/" title="Java中常见面试题一（简单）">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Java中常见面试题一（简单）"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2022/01/07/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%B8%80%EF%BC%88%E7%AE%80%E5%8D%95%EF%BC%89/" title="Java中常见面试题一（简单）">Java中常见面试题一（简单）</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2022-01-07T15:34:18.000Z" title="Created 2022-01-07 23:34:18">2022-01-07</time></span></div><div class="content">Java中常见面试题一（简单）
面向对象的特征有哪些方面? 


抽象：抽象就是忽略一个主题中与当前目标无关的那些方面，以便更充分地注意与当前目标有关的方面。抽象并不打算了解全部问题，而只是选择其中的一部分，暂时不用部分细节。抽象包括两个方面，一是过程抽象,二是数据抽象。

继承：继承是一种联结类的层次模型，并且允许和鼓励类的重用，它提供了一种明确表述共性的方法。对象的一个新类可以从现有的类中派生，这个过程称为类继承。新类继承了原始类的特性，新类称为原始类的派生类（子类），而原始类称为新类的基类（父类）。派生类可以从它的基类那里继承方法和实例变量，并且类可以修改或增加新的方法使之更适合特殊的需要。

封装：封装是把过程和数据包围起来，对数据的访问只能通过已定义的界面。面向对象计算始于这个基本概念，即现实世界可以被描绘成一系列完全自治、封装的对象,这些对象通过一个受保护的接口访问其他对象。

多态性：多态性是指允许不同类的对象对同一消息作出响应。多态性包括参数化多态性和包含多态性。多态性语言具有灵活、抽象、行为共享、代码共享的优势，很好的解决了应用程序函数同名问题。



Enumera ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/codingdgsun/2022/01/06/MySQL%E8%AF%AD%E6%B3%95%E5%85%A5%E9%97%A8%EF%BC%88%E4%B8%80%EF%BC%89/" title="MySQL语法入门（一）">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="MySQL语法入门（一）"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2022/01/06/MySQL%E8%AF%AD%E6%B3%95%E5%85%A5%E9%97%A8%EF%BC%88%E4%B8%80%EF%BC%89/" title="MySQL语法入门（一）">MySQL语法入门（一）</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2022-01-06T08:50:45.000Z" title="Created 2022-01-06 16:50:45">2022-01-06</time></span></div><div class="content">MySQL语法入门（一）
基本运算符使用

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960SELECT 1 + 2;-- 3SELECT 1 / 0;-- nullSELECT 1 + NULL;-- nullSELECT &#x27;2&#x27; * &#x27;4&#x27;;-- 8SELECT &#x27;2f&#x27; + 3;-- 5SELECT 2.2 + 2;-- 4.2SELECT 1 = 2;-- 0SELECT 1 = 1;-- 1SELECT 1 = NULL;-- nullSELECT 1 &lt;=&gt; NULL;-- 0SELECT &#x27;hello&#x27; = &#x27;HELLO&#x27;;-- 1SELECT &#x27;hello&#x27; = &#x27;  HELLO    &#x27;;-- 0SELECT BINARY &#x27;hello& ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/codingdgsun/2021/12/31/Java%E4%B8%AD%E7%9A%84%E6%A1%A5%E6%8E%A5%E6%A8%A1%E5%BC%8F/" title="Java中的桥接模式">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Java中的桥接模式"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2021/12/31/Java%E4%B8%AD%E7%9A%84%E6%A1%A5%E6%8E%A5%E6%A8%A1%E5%BC%8F/" title="Java中的桥接模式">Java中的桥接模式</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2021-12-31T05:58:38.000Z" title="Created 2021-12-31 13:58:38">2021-12-31</time></span></div><div class="content">桥接模式简介
桥接是用于把抽象化与实现化解耦，使得二者可以独立变化。这种类型的设计模式属于结构型模式，它通过提供抽象化和实现化之间的桥接结构，来实现二者的解耦。
这种模式涉及到一个作为桥接的接口，使得实体类的功能独立于接口实现类。这两种类型的类可被结构化改变而互不影响。

品牌接口Brand1234//产品品牌public interface Brand &#123;    void name();&#125;

实现类品牌A和品牌B123456789101112131415//A品牌public class ABrand implements Brand &#123;    @Override    public void name() &#123;        System.out.print(&quot;A品牌&quot;);    &#125;&#125;//B品牌public class BBrand implements Brand &#123;    @Override    public void name() &#123;        System.out.pri ...</div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/codingdgsun/page/2/#content-inner">2</a><span class="space">&hellip;</span><a class="page-number" href="/codingdgsun/page/6/#content-inner">6</a><a class="extend next" rel="next" href="/codingdgsun/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/头像.7horht40yvwg.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">CodingDGSun</div><div class="author-info__description"></div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/codingdgsun/archives/"><div class="headline">Articles</div><div class="length-num">59</div></a></div></div><a class="button--animated" id="card-info-btn" href="https://sunjie23.gitee.io/codingdgsun"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>Announcement</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>Recent Post</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AEbuild%E5%A4%B1%E8%B4%A5%E4%B9%8BMiniCssExtractPlugin/" title="React项目build失败之MiniCssExtractPlugin"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="React项目build失败之MiniCssExtractPlugin"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AEbuild%E5%A4%B1%E8%B4%A5%E4%B9%8BMiniCssExtractPlugin/" title="React项目build失败之MiniCssExtractPlugin">React项目build失败之MiniCssExtractPlugin</a><time datetime="2022-01-17T06:03:03.000Z" title="Created 2022-01-17 14:03:03">2022-01-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AE%E6%9E%84%E5%BB%BA%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/" title="React项目构建常用命令"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="React项目构建常用命令"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AE%E6%9E%84%E5%BB%BA%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/" title="React项目构建常用命令">React项目构建常用命令</a><time datetime="2022-01-17T06:01:56.000Z" title="Created 2022-01-17 14:01:56">2022-01-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/Mac-OS%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%80%E4%B8%AAReact%E9%A1%B9%E7%9B%AE/" title="Mac OS初始化一个React项目"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Mac OS初始化一个React项目"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/Mac-OS%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%80%E4%B8%AAReact%E9%A1%B9%E7%9B%AE/" title="Mac OS初始化一个React项目">Mac OS初始化一个React项目</a><time datetime="2022-01-17T05:58:21.000Z" title="Created 2022-01-17 13:58:21">2022-01-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/MySQL%E8%AF%AD%E6%B3%95%E5%85%A5%E9%97%A8%EF%BC%88%E4%BA%8C%EF%BC%89/" title="MySQL语法入门（二）"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="MySQL语法入门（二）"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/MySQL%E8%AF%AD%E6%B3%95%E5%85%A5%E9%97%A8%EF%BC%88%E4%BA%8C%EF%BC%89/" title="MySQL语法入门（二）">MySQL语法入门（二）</a><time datetime="2022-01-17T05:54:56.000Z" title="Created 2022-01-17 13:54:56">2022-01-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%BA%8C%EF%BC%88%E7%AE%80%E5%8D%95%EF%BC%89/" title="Java中常见面试题二（简单）"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Java中常见面试题二（简单）"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%BA%8C%EF%BC%88%E7%AE%80%E5%8D%95%EF%BC%89/" title="Java中常见面试题二（简单）">Java中常见面试题二（简单）</a><time datetime="2022-01-17T05:53:56.000Z" title="Created 2022-01-17 13:53:56">2022-01-17</time></div></div></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>Archives</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/codingdgsun/archives/2022/01/"><span class="card-archive-list-date">January 2022</span><span class="card-archive-list-count">9</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/codingdgsun/archives/2021/12/"><span class="card-archive-list-date">December 2021</span><span class="card-archive-list-count">21</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/codingdgsun/archives/2021/07/"><span class="card-archive-list-date">July 2021</span><span class="card-archive-list-count">15</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/codingdgsun/archives/2021/06/"><span class="card-archive-list-date">June 2021</span><span class="card-archive-list-count">14</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>Info</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">Article :</div><div class="item-count">59</div></div><div class="webinfo-item"><div class="item-name">UV :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">PV :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">Last Push :</div><div class="item-count" id="last-push-date" data-lastPushDate="2022-01-17T06:06:45.477Z"></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By CodingDGSun</div><div class="framework-info"><span>Framework </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>Theme </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="Switch Between Light And Dark Mode"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="Toggle between single-column and double-column"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="Setting"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="Back To Top"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/codingdgsun/js/utils.js"></script><script src="/codingdgsun/js/main.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>